﻿using FixMath;
using UnityEngine;

namespace UniFramework.Battle
{
	[System.Serializable]
	public class LogicActorProperty
	{
		public int hp;
		public bool dead => hp <= 0;
		public FixInt attack;
		public FixInt moveSpeed;
		public FixInt actionScale; //行动缩放，比如提高攻速，移速等
		public static LogicActorProperty zero = new LogicActorProperty(0, 0, 0);
		public static LogicActorProperty defalut = new LogicActorProperty(1, 100, 1);

		public LogicActorProperty(int moveSpeed, int hp, int attack, int actionSpeed = 1)
		{
			this.moveSpeed = moveSpeed;
			this.hp = hp;
			this.attack = attack;
			this.actionScale = actionSpeed;
		}

		public void Zero()
		{
			this.hp = 0;
			this.moveSpeed = 0;
			this.attack = 0;
		}
	}
}